﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;

namespace Home.Domain.Entities
{
    /// <summary>
    /// 业务员
    /// </summary>
    public class Salesman
    {
        /// <summary>
        /// Id
        /// </summary>
        [DisplayName("Id")]
        public int? Id { get; set; }
        /// <summary>
        /// 姓名
        /// </summary>
        [DisplayName("姓名")]
        [StringLength(5, ErrorMessage = "长度不能超过5个字符")]
        [Required(ErrorMessage = "姓名不能为空")]
        public string Name { get; set; }
        /// <summary>
        /// 用户名
        /// </summary>
        [DisplayName("用户名")]
        [StringLength(25, ErrorMessage = "长度不能超过25个字符")]
        [Required(ErrorMessage = "用户名不能为空")]
        public string UserName { get; set; }
        /// <summary>
        /// 密码
        /// </summary>
        [DisplayName("密码")]
        [StringLength(25, ErrorMessage = "长度不能超过25个字符")]
        [Required(ErrorMessage = "密码不能为空")]
        public string PassWord { get; set; }
        /// <summary>
        /// 状态1正常，0禁用
        /// </summary>
        public int? State { get; set; }
        /// <summary>
        /// 创建时间
        /// </summary>
        [DisplayName("创建时间")]
        public DateTime? CreateDate { get; set; }
        /// <summary>
        /// 邀请码列表
        /// </summary>
        public virtual ICollection<InviteCode> InviteCodes { get; set; }
        /// <summary>
        /// 邀请人列表
        /// </summary>
        public virtual ICollection<UserInfo> UserInfos { get; set; } 
    }
}
